<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Document</title>
  </head>
  <body>
    <script>
      function getArrMax(arr) {
        var max = arr[0];
        for (var i = 1; i <= arr.length; i++) {
          if (arr[i] > max) {
            max = arr[i];
          }
        }
        return max;
      }
      var arr = getArrMax([5, 2, 99, 101, 67, 77]);
      console.log(arr);	// 输出结果：101
    </script>
  </body>
</html>